import Cookies from 'js-cookie'

const TokenKey = 'id_token'
const name = "userId"
const user ="userName"
const json = 'tree'
const id = "discussId"
const role = "permissions" 
export function getToken () {
  return Cookies.get(TokenKey)
}

export function setToken (token) {
  return Cookies.set(TokenKey, token)
}

export function setUserId (userId) {
  return Cookies.set(name, userId)
}
export function getUserId () {
  return Cookies.get(name)
}
export function setUserName (userName) {
  return Cookies.set(user, userName)
}
export function getUserName () {
  return Cookies.get(user)
}
export function setPermissions (permissions) {
  return Cookies.set(role, permissions)
}
export function getPermissions () {
  return Cookies.get(role)
}
export function removeToken () {
  return Cookies.remove(TokenKey)
}
export function setJson (data) {
  return Cookies.set(json, data)
}
export function setDiscussId (data) {
  return Cookies.set(id, data)
}
export function getDiscussId() {
  return Cookies.get(id)
}
